# Contributor: Karim Kanso <kaz.kanso@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=daq
pkgver=3.0.14
pkgrel=0
pkgdesc="Data Acquisition library - packet I/O library"
url="https://www.snort.org/"
arch="all"
license="GPL-2.0-only"
makedepends="
	autoconf
	automake
	bison
	flex
	libdnet-dev
	libmnl-dev
	libnetfilter_queue-dev
	libnfnetlink-dev
	libpcap-dev
	libtool
	linux-headers
	"
checkdepends="cmocka-dev"
subpackages="$pkgname-static $pkgname-dev"
source="https://www.snort.org/downloads/snortplus/libdaq-$pkgver.tar.gz"
builddir="$srcdir/libdaq-$pkgver"
options="!check" # requires a wrap for some glibc __functions

prepare() {
	default_prepare
	./bootstrap
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	cd "$pkgdir"
	rm -v usr/bin/daqtest*
}

sha512sums="
3c50efbc96ff5865a7b57799b65d4be70f6dbd29e0d12fc7b46d9c523eefb9b968a4a8294dc2ec424c93d5265c97d1266ca0942ac3684cdf1f06a742c2c3b404  libdaq-3.0.14.tar.gz
"
